﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="ComparativeAnalysis.aspx.cs"
    Inherits="ReportAnalysis_ComparativeAnalysis" %>

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>月度报表指标选项查询</title>
    <link rel="stylesheet" href="../css/css.css" type="text/css" />
    <link rel="stylesheet" href="../css/DropDownList.css" type="text/css" />

    <script src="../js/Common.js" type="text/javascript"></script>

    <script src="../JS/calendar.js" type="text/javascript"></script>

    <script src="../JS/DropDownList.js" type="text/javascript"></script>

    <script src="../JS/TreeView.js" type="text/javascript"></script>

    <script language="javascript" type="text/javascript">
    function change(id)
    {
        var obj = $("txtlst").value;
        if(id=="divTmp")
        {
            $("sltYears").style.display="none";
        }
        else
        {
            $("sltYears").style.display="";
        }
        if(id!="")
        {
            if(obj=="")
            {
                $(id).style.display="";
                $("txtlst").value = id;
            }
            else
            {
                $(obj).style.display="none";
                $(id).style.display="";
                $("txtlst").value = id;
            }
            $("txtArea").value="";
        }
        else
        {
            if(obj!="")
            {
                $(obj).style.display="none";
                $("btn").click();
            }
        }
    }
    function SetHiddenArea()
    {
        var ele = event.srcElement;
        if(ele.type=='checkbox')
        {
            var area = $("txtArea");
            if(area!="")
            {
                var aryarea = area.value.split(',');
                var aryyear = $("txtYears").value.split(',');
                if($("brlType_0").disabled&&aryyear.length>2&&aryarea.length>1)
                {
                    ele.checked=false;
                    var txt = $("txtArea").value;
                    txt = txt.replace(","+ele.parentNode.innerText,"");
                    $("txtArea").value = txt.replace(ele.parentNode.innerText+",","");
                    alert("当前默认报表时同区报表，请重新选择某个区域！")
                }
                else
                {
                    if(aryarea.length>1&&!$("brlType_0").disabled)
                    {
                        $("brlType_1").disabled=true;
                        $("brlType_0").checked=true;
                    }
                    else
                        $("brlType_1").disabled=false;
                }
            }
        }
    }
    function SetHiddenYears()
    {
        var ele = event.srcElement;
        if(ele.type=='checkbox')
        {
            var id=$("txtYears");
            if(id!="")
            {
                var ary = id.value.split(',');
                var aryarea = $("txtArea").value.split(',');
                if(ary.length>2)
                    $("tblType_1").disabled=true;
                else
                    $("tblType_1").disabled=false;
                if(aryarea.length>1&&ary.length>2)
                {
                    ele.checked=false;
                    var year = $("txtYears").value.split(',');
                    $("txtYears").value = year[0]+",";
                    $("tblType_1").disabled=false;
                    alert("当前默认报表时同月报表，请重新选择某个月份！")
                }
                else
                {
                    if(ary.length>2&&!$("brlType_1").disabled)
                    {
                        $("brlType_0").disabled=true;
                        $("brlType_1").checked=true;
                    }
                    else
                    {
                        $("brlType_0").disabled=false;
                    }
                }
            }
        }
    }
    function SetHiddenItems()
    {
        var id=$("txtItems");
        if(id!="")
        {
            var ary = id.value.split(',');
            if(ary.length>1)
            {
                $("brlType_2").disabled=true;
                $("brlType_3").disabled=true;
            }
            else
            {
                $("brlType_2").disabled=false;
                $("brlType_3").disabled=false;
            }       
        }
    }
    function FindContrast(obj)
    {
        var items = $("lstItems");
        if(items!="")
        {
            var checkBoxs = items.getElementsByTagName('INPUT');
            for(var i=0;i<checkBoxs.length;i++)
            {
                if(checkBoxs[i].type=='checkbox')
                {
                    checkBoxs[i].checked=false;
                }
            }
        }
    }
    function ChangeBrl()
    {
    }
    function Save(obj)
    {
        var tmp = "";
        var tmp1 = "";
        if($("brlType_0").disabled)
            tmp="1";
        else
            tmp="0";
        if($("brlType_1").disabled)
            tmp+=",1";
        else
            tmp+=",0";
        if($("tblType_1").disabled)
            tmp1="1";
        else
            tmp1="0";
        $("hidState").value = tmp+"|"+tmp1;
        if(obj=="1")
            $("btnQuery").click();
        else
            $("btnReport").click();
    }
    </script>

</head>
<body style="background-image: url('../images/hit_bg.gif');">
    <% 
        Response.ExpiresAbsolute = System.DateTime.Now.AddSeconds(-1);
        Response.Expires = 0;
        Response.CacheControl = "no-cache";
    %>
    <form method="post" enctype="multipart/form-data" id="form1" runat="server">
        <table style="width: 98%;" border="0" align="center" cellpadding="0" cellspacing="0">
            <tr>
                <td valign="middle" style="height: 25; width: 100%;">
                    <img id="imgIndicator" src="../images/Indicator.jpg" style="width: 21; height: 16;"
                        alt="当前位置" />当前位置：<asp:Label ID="Indicator" runat="server"></asp:Label></td>
            </tr>
            <tr style="height: 1; background-color: #dddddd;">
                <td>
                </td>
            </tr>
        </table>
        <table style="width: 98%;" border="0" align="center" cellpadding="0" cellspacing="0">
            <tr style="height: 5;">
                <td>
                </td>
            </tr>
        </table>
        <table width="98%" border="0" cellpadding="0" class="table" cellspacing="0" align="center">
            <tr>
                <td align="center" valign="top">
                    <!--搜索开始-->
                    <table width="98%" border="0" align="center" cellpadding="3" cellspacing="3">
                        <tr>
                            <td  align="right">
                                属性项：
                            </td>
                            <td align="left">
                                <select id="slt" runat="server" style="width: 150px;" onchange="change(this.value)">
                                    <option value="">请选择属性项...</option>
                                    <option value="ddlLargeArea">大区域</option>
                                    <option value="ddlArea">相邻区域</option>
                                    <option value="ddlEquipment1">主设备1</option>
                                    <option value="ddlEquipment2">主设备2</option>
                                    <option value="ddlEquipment3">主设备3</option>
                                    <option value="divTmp">温度</option>
                                </select>
                            </td>
                            <td align="right">
                                属性：
                            </td>
                            <td align="left">
                                <asp:DropDownList ID="ddlLargeArea" runat="server" AutoPostBack="true" Style="width: 150px;
                                    display: none;" OnSelectedIndexChanged="ddlLargeArea_SelectedIndexChanged">
                                </asp:DropDownList>
                                <asp:DropDownList ID="ddlEquipment1" runat="server" AutoPostBack="true" Style="width: 150px;
                                    display: none;" OnSelectedIndexChanged="ddlEquipment1_SelectedIndexChanged">
                                </asp:DropDownList>
                                <asp:DropDownList ID="ddlEquipment2" runat="server" AutoPostBack="true" Style="width: 150px;
                                    display: none;" OnSelectedIndexChanged="ddlEquipment2_SelectedIndexChanged">
                                </asp:DropDownList>
                                <asp:DropDownList ID="ddlEquipment3" runat="server" AutoPostBack="true" Style="width: 150px;
                                    display: none;" OnSelectedIndexChanged="ddlEquipment3_SelectedIndexChanged">
                                </asp:DropDownList>
                                <asp:DropDownList ID="ddlArea" runat="server" AutoPostBack="true" Style="width: 110px;
                                    display: none;" OnSelectedIndexChanged="ddlArea_SelectedIndexChanged">
                                </asp:DropDownList><input id="txtlst" type="hidden" runat="server" />
                                 <div id="divTmp" runat="server" style="display: none;">
                                    <asp:DropDownList ID="ddlYears" runat="server" Width="110px">
                                    </asp:DropDownList>
                                    <asp:TextBox ID="txtMin" runat="server" Width="40px"></asp:TextBox>～<asp:TextBox
                                        ID="txtMax" runat="server" Width="40px"></asp:TextBox>
                                    <asp:Button ID="btnArea" runat="server" Height="0px" Width="0px" Text="" OnClick="btnArea_Click" />
                                    <input id="txttmp" type="hidden" runat="server" />
                                </div>
                            </td>
                        </tr>
                        <tr>
                            <td align="right">
                                区域：</td>
                            <td style="width: 35%;" align="left">
                                <!--区域下拉框（呈现属性的多选列表）START-->
                                <div id="sltArea" runat="server" style="float: left;" onmouseover="ShowMList('divCheckBoxList','divCheckBoxListClose');"
                                    onmouseout="HideMList('divCheckBoxList','divCheckBoxListClose');">
                                    <table>
                                        <tr>
                                            <td align="right" class="DropDownLook">
                                                <input id="txtArea" type="text" readonly="readonly" onclick="ShowMList('divCheckBoxList','divCheckBoxListClose')"
                                                    style="width: 229px;" runat="server" />
                                            </td>
                                            <td align="left" class="DropDownLook">
                                                <img alt="" id="imgShowHide" runat="server" src="../Images/drop.gif" onclick="ShowMList('divCheckBoxList','divCheckBoxListClose')"
                                                    align="left" />
                                            </td>
                                        </tr>
                                        <tr>
                                            <td colspan="2" class="DropDownLook">
                                                <div>
                                                    <div runat="server" id="divCheckBoxListClose" class="DivClose">
                                                        <label runat="server" onclick="HideMList('divCheckBoxList','divCheckBoxListClose');"
                                                            class="LabelClose" id="lblClose">
                                                            关闭
                                                        </label>
                                                    </div>
                                                    <div runat="server" id="divCheckBoxList" class="DivCheckBoxList">
                                                        <asp:CheckBoxList ID="lstArea" runat="server" Width="250px" CssClass="CheckBoxList">
                                                        </asp:CheckBoxList>
                                                    </div>
                                                </div>
                                            </td>
                                        </tr>
                                    </table>
                                </div>
                            </td>
                            <td align="right">
                                分析项：</td>
                            <!--区域下拉框（呈现属性的多选列表）END-->
                            <td style="width: 40%" align="left">
                                <asp:RadioButtonList ID="rblIndicators" runat="server" RepeatDirection="Horizontal">
                                    <asp:ListItem Value="1" Selected="True">总电量</asp:ListItem>
                                    <asp:ListItem Value="2">分项电量对比</asp:ListItem>
                                    <asp:ListItem Value="3">单位业务量能耗</asp:ListItem>
                                </asp:RadioButtonList></td>
                        </tr>
                        <tr>
                            <td align="right">
                                查询日期：
                            </td>
                            <td style="height: 46px">
                                <!-- 树形下拉框 -->
                                <div id="sltYears" style="float: left;" runat="server" onmouseover="ShowMList('divCheckBoxList3','divCheckBoxListClose3');"
                                    onmouseout="HideMList('divCheckBoxList3','divCheckBoxListClose3');">
                                    <table>
                                        <tr>
                                            <td align="right" class="DropDownLook">
                                                <input id="txtYears" type="text" readonly="readonly" onclick="ShowMList('divCheckBoxList3','divCheckBoxListClose3')"
                                                    style="width: 229px;" runat="server" />
                                            </td>
                                            <td align="left" class="DropDownLook">
                                                <img alt="" id="img1" runat="server" src="../Images/drop.gif" onclick="ShowMList('divCheckBoxList3','divCheckBoxListClose3')"
                                                    align="left" />
                                            </td>
                                        </tr>
                                        <tr>
                                            <td colspan="2" class="DropDownLook">
                                                <div>
                                                    <div runat="server" id="divCheckBoxListClose3" class="DivClose">
                                                        <label runat="server" onclick="HideMList('divCheckBoxList3','divCheckBoxListClose3');"
                                                            class="LabelClose" id="lblClose3">
                                                            关闭
                                                        </label>
                                                    </div>
                                                    <div runat="server" id="divCheckBoxList3" class="DivCheckBoxList">
                                                        <asp:TreeView ID="tvYears" runat="server" ShowCheckBoxes="All" ShowLines="True" ExpandDepth="0"
                                                            onclick="OnTreeNodeChecked();SetHiddenYears();">
                                                        </asp:TreeView>
                                                    </div>
                                                </div>
                                            </td>
                                        </tr>
                                    </table>
                                </div>
                                <!-- 树形下拉框 -->
                            </td>
                            <td style="width: 15%; height: 46px;" align="right">
                                口径：
                            </td>
                            <td style="height: 46px">
                                <asp:RadioButtonList ID="tblType" runat="server" RepeatDirection="Horizontal">
                                    <asp:ListItem Value="1" Selected="True">当月量</asp:ListItem>
                                    <asp:ListItem Value="2">累积量</asp:ListItem>
                                </asp:RadioButtonList>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2" align="left">
                                <asp:RadioButtonList ID="brlType" runat="server" RepeatDirection="Horizontal">
                                    <asp:ListItem Value="1" Selected="True">同月图表</asp:ListItem>
                                    <asp:ListItem Value="2">同区图表</asp:ListItem>
                                </asp:RadioButtonList>
                            </td>
                            <td align="left">
                                <asp:RadioButtonList ID="brlGraphic" runat="server" RepeatDirection="Horizontal">
                                    <asp:ListItem Value="1" Selected="True">柱状</asp:ListItem>
                                    <asp:ListItem Value="2">折线</asp:ListItem>
                                </asp:RadioButtonList>
                            </td>
                            <td align="right">
                                <input id="btnSave" type="button" value="列  表" class="button06" onclick="Save(1)" />
                                <input id="btnRep" type="button" value="图  表" class="button06" onclick="Save(2)" />
                                <asp:Button ID="btnQuery" runat="server" Width="0px" Height="0px" CssClass="button06"
                                    Text="列  表" OnClick="btnQuery_Click" />&nbsp;<input id="btnReport"
                                        type="button" runat="server" class="button06" value="图  表" style="display: none"
                                        onserverclick="btnReport_ServerClick" />&nbsp;<asp:CheckBox ID="cbShowData"
                                            Text="显示数据" runat="server" Visible="false" AutoPostBack="true" OnCheckedChanged="cbShowData_CheckedChanged" />
                            </td>
                        </tr>
                    </table>
                    <input type="hidden" id="HiddenID" name="HiddenID" runat="server" />
                    <asp:GridView ID="GridView1" runat="server" CellPadding="4" OnRowDataBound="GridView1_RowDataBound"
                        BackColor="SteelBlue" BorderColor="DarkSlateGray" BorderStyle="Solid" BorderWidth="0px"
                        CellSpacing="1" Width="100%" AutoGenerateColumns="true" Font-Overline="False"
                        Font-Strikeout="False" Font-Underline="False" OnSorting="GridView1_Sorting">
                        <FooterStyle BackColor="#990000" Font-Bold="True" ForeColor="#F9F9FB" />
                        <RowStyle BackColor="#F9F9FB" ForeColor="#333333" Height="24px" BorderStyle="Dotted" />
                        <AlternatingRowStyle BackColor="#EFEFF8" />
                        <HeaderStyle BackColor="#E3E7F0" Height="25px" />
                    </asp:GridView>
                    <asp:Image ID="imgReport" Visible="false" runat="server" />
                    <asp:Label ID="Text_Confirm_Upstate" runat="server" Style="text-align: left;" BackColor="#FFFF80"
                        BorderColor="Red" BorderStyle="Dashed" BorderWidth="2px" Width="400px" Visible="false"></asp:Label>
                </td>
            </tr>
        </table>
        <asp:Button ID="btn" runat="server" Width="0px" Height="0px" Text="Button" OnClick="btn_Click" />
        <input id="hidState" type="hidden" runat="server" />
    </form>
</body>

<script language="javascript" type="text/javascript">
    var obj = $("txtlst").value;
    if(obj!="")
         $(obj).style.display="";
    var obj = $("hidState").value;
    var ary = obj.split('|');
    var ary1 = ary[0].split(',');
    if(ary1[0]=="1")
        $("brlType_0").disabled=true;
    else if(ary1[1]=="1")
        $("brlType_1").disabled=true;
    if(ary[1]=="1")
        $("brlGraphic_1").disabled=true;
    var id = $("slt").value;
    if(id=="divTmp")
    {
        $("sltYears").style.display="none";
    }
    else
    {
        $("sltYears").style.display="";
    }
</script>

</html>
